<script>
	// <!--
		
	$(function(){
		/* declarisasi */
		txtsettingreminder = $("#txt-settingreminder");
		btnSimpansettingreminder = $("#btn-simpansettingreminder");
		formsettingreminder = $("#form-settingreminder");
		
		/* function */
			
		function reloaddata(){
			$.ajax({
				url : "c_settingreminder",
				data : {task : "RELOAD"},
				type : 'POST'
			}).done(function(response){
				txtsettingreminder.val(response);
			});
		}
				
		/* event */
		btnSimpansettingreminder.click(function(){
			
			dayreminder = txtsettingreminder.val();;
			if (dayreminder == ""){
				alert("Tidak boleh kosong!");
			}else{			
				$.ajax({
					url : "c_settingreminder",
					data : {task : "SAVE",day : dayreminder},
					type : 'POST'
				}).done(function(response){
					if (response == "1"){
						reloaddata();
						alert("Berhasil disimpan!");
					}
				});
			}
		});
		
		/* method started */
		reloaddata();
	});
	// -->
</script>

<form class="form-horizontal" id="form-settingreminder" disabled=true>
	<input  name="task" value="SAVE" placeholder="0" hidden=hidden>
	<div class="control-group">
		<label class="control-label left" for="settingreminder">Tampilkan data </label>
		<div class="controls">
			<input type="text" id="txt-settingreminder" name="txt-settingreminder" class="input-control" size=2> Hari sebelum tanggal serah terima
		</div>
	</div>
	<div class="form-actions">
            <a class="button" id="btn-simpansettingreminder"><span>Simpan</span></a>
<!-- 			>Simpan</button></a> -->
	</div>
</form>